package com.gitee.wsl.reflect.func.call.binding

import com.gitee.wsl.reflect.func.FunctionParameter
import com.gitee.wsl.reflect.func.InjectedValue
import com.gitee.wsl.reflect.func.call.FunctionCall
import com.gitee.wsl.reflect.func.call.FunctionCallArgument
import kotlin.reflect.KClass

/**
 * Builder of bindings for the injected argument subset of a function call.
 * @param call function call to bind arguments for
 * @see FunctionParameter.isInjected
 */
open class InjectedArgumentsBinder(private val call: FunctionCall<*>) : ArgumentsBinder {

    fun getInjectedValue(type: KClass<*>): InjectedValue {
        TODO()
    }
    override fun createBindings(parameters: List<FunctionParameter<*>>) =
        parameters.associateWith {
            val value = getInjectedValue(it.type).fromType(it.type, call)
            FunctionCallArgument(value)
        }
}